﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BesAsm.Emgaats.Core;
using BesAsm.Emgaats.Core.Commands;

namespace BesAsm.Emgaats.ModelBuilder.Commands
{
  /// <summary>
  /// Generate a stormwater controls file for a model
  /// </summary>
  public class DeployStormwaterControlsCommand : SingleCommand
  {
    private Model _model;
    private StormwaterControlsBuilder _stormwaterControlsBuilder;

    /// <summary>
    /// Initializes the command for building stormwater controls
    /// </summary>
    /// <param name="model">The model for which to apply stormwater controls</param>
    public DeployStormwaterControlsCommand(Model model)
    {
      _model = model;
      _stormwaterControlsBuilder = new StormwaterControlsBuilder(model);
    }

    #region IEmgaatsExtensionCommand Members

    public override void Execute()
    {
      base.Execute();
      _stormwaterControlsBuilder.DeployStormwaterControls();
    }

    public override void Undo()
    {
      throw new NotImplementedException();
    }

    public override string Name
    {
      get { return "Deploy stormwater controls file"; }
    }

    public override string Description
    {
      get { return "Calculates and creates a stormwater controls engine file"; }
    }

    #endregion

  }
}
